App({
    tool: require('./utils/tool'),
    api: require('./utils/api'),
    time: require('./utils/time'),
    // 页码显示
    onShow() {
        wx.onAppRoute(res => {
            let path = [
                'pages/user/login/index',
                'pages/user/register/index'
            ]
            if (path.indexOf(res.path) == -1) {
                this.api.getStorage('loginTime').then(loginTime => {
                    if (loginTime && this.time.getStamp() < loginTime) return;
                    this.api.showModal('提示','登录已过期，请重新登录',false).then(res => {
                        this.api.navigateTo('/pages/user/login/index')
                    })
                })
            }
        })
    },
})